package com.sixth.docker.controller;

import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
import com.sixth.core.entity.PatientFile;
import com.sixth.core.vo.R;
import com.sixth.docker.service.PatientFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: sixth-hospital-parent
 * @description:
 * @author: 赵庆龙
 * @create: 2024-08-21 19:54
 **/
@RestController
@RequestMapping("/doctor/patientFile")
public class PatientFileController {
    @Autowired
    private PatientFileService patientFileService;
    @GetMapping("/selectById/{patientId}")
    public R<PatientFile> selectById(@PathVariable String patientId){
        return patientFileService.selectById(patientId);
    }

    @PutMapping("/update")
    public R<PatientFile> update(@RequestBody PatientFile patientFile) {
        return patientFileService.updateById(patientFile);
    }
    @PostMapping("/insert")
    public R<PatientFile> insert(@RequestBody PatientFile patientFile) {
        return patientFileService.insert(patientFile);
    }
//删除患者信息
    @DeleteMapping("/delete/{patientId}")
    public R<PatientFile> delete(@PathVariable String patientId) {
        return patientFileService.deleteById(patientId);
    }
}
